<html>
<head>
<title>The X Toolkit API</title>
<link href="doc.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load('visualization', '1', {packages: ['orgchart']});
</script>
<script type="text/javascript">

  // don't show internals by default
  var displayInternals = false;

  var toggleInternals = function() {
    
    // toggle the display variable
    displayInternals = !displayInternals;

    if (!document.styleSheets)
      return;
    var thecss = new Array();
    
    if (document.styleSheets[0].cssRules) thecss = document.styleSheets[0].cssRules;
    else thecss = document.styleSheets[0].rules;
    
    for (i = 0; i < thecss.length; i++) {
      
      if (thecss[i].selectorText.toLowerCase() == '.private') {
        
        if (displayInternals) {
          thecss[i].style.cssText += "display: block;";
          document.getElementById('togglBtn').innerHTML = 'Hide Internals'
        } else {
          thecss[i].style.cssText += "display: none;";
          document.getElementById('togglBtn').innerHTML = 'Show Internals'
        }
      
      } else if (thecss[i].selectorText.toLowerCase() == '.private_quicklink') {
        
        if (displayInternals) {
          thecss[i].style.cssText += "display: inline;";
        } else {
          thecss[i].style.cssText += "display: none;";
        }
        
      }
       
    }
    
  }
  
  function drawVisualization() {
    // Create and populate the data table.
    var data = google.visualization.arrayToDataTable([
      [{v:"goog.events.EventTarget",f:"<font color=green>goog.events.EventTarget</font>"},null,null],
["X.base","goog.events.EventTarget",null],
["X.parser","X.base",null],

    ]);
  
    // Create and draw the visualization.
    new google.visualization.OrgChart(document.getElementById('diagram')).
        draw(data, {allowHtml: true, size:'small', color:'#f3f3f3'});
  }
  

  google.setOnLoadCallback(drawVisualization);  
  
</script>
</head>

<body>
	<h1>The X Toolkit API</h1>
	<div class="menu"><b>X</b><br><span class="menuitem"><a href="counter.html">X.counter</a></span><br><br><b>CORE</b><br><span class="menuitem"><a href="base.html">X.base</a></span><br><span class="menuitem"><a href="colortable.html">X.colortable</a></span><br><span class="menuitem"><a href="event.html">X.event</a></span><br><span class="menuitem"><a href="file.html">X.file</a></span><br><span class="menuitem"><a href="HoverEndEvent.html">X.HoverEndEvent</a></span><br><span class="menuitem"><a href="HoverEvent.html">X.HoverEvent</a></span><br><span class="menuitem"><a href="ModifiedEvent.html">X.ModifiedEvent</a></span><br><span class="menuitem"><a href="PanEvent.html">X.PanEvent</a></span><br><span class="menuitem"><a href="ProgressEvent.html">X.ProgressEvent</a></span><br><span class="menuitem"><a href="RenderEvent.html">X.RenderEvent</a></span><br><span class="menuitem"><a href="ResetViewEvent.html">X.ResetViewEvent</a></span><br><span class="menuitem"><a href="RotateEvent.html">X.RotateEvent</a></span><br><span class="menuitem"><a href="scalars.html">X.scalars</a></span><br><span class="menuitem"><a href="ScrollEvent.html">X.ScrollEvent</a></span><br><span class="menuitem"><a href="texture.html">X.texture</a></span><br><span class="menuitem"><a href="transform.html">X.transform</a></span><br><span class="menuitem"><a href="triplets.html">X.triplets</a></span><br><span class="menuitem"><a href="WindowLevelEvent.html">X.WindowLevelEvent</a></span><br><span class="menuitem"><a href="ZoomEvent.html">X.ZoomEvent</a></span><br><br><b>INJECTS</b><br><span class="menuitem"><a href="constructable.html">X.constructable</a></span><br><span class="menuitem"><a href="displayable.html">X.displayable</a></span><br><span class="menuitem"><a href="loadable.html">X.loadable</a></span><br><span class="menuitem"><a href="thresholdable.html">X.thresholdable</a></span><br><br><b>IO</b><br><span class="menuitem"><a href="interactor.html">X.interactor</a></span><br><span class="menuitem"><a href="interactor2D.html">X.interactor2D</a></span><br><span class="menuitem"><a href="interactor3D.html">X.interactor3D</a></span><br><span class="menuitem"><a href="loader.html">X.loader</a></span><br><span class="menuitem"><a href="parser.html">X.parser</a></span><br><span class="menuitem"><a href="parserCRV.html">X.parserCRV</a></span><br><span class="menuitem"><a href="parserDCM.html">X.parserDCM</a></span><br><span class="menuitem"><a href="parserFSM.html">X.parserFSM</a></span><br><span class="menuitem"><a href="parserIMAGE.html">X.parserIMAGE</a></span><br><span class="menuitem"><a href="parserLBL.html">X.parserLBL</a></span><br><span class="menuitem"><a href="parserLUT.html">X.parserLUT</a></span><br><span class="menuitem"><a href="parserMGZ.html">X.parserMGZ</a></span><br><span class="menuitem"><a href="parserNII.html">X.parserNII</a></span><br><span class="menuitem"><a href="parserNRRD.html">X.parserNRRD</a></span><br><span class="menuitem"><a href="parserOBJ.html">X.parserOBJ</a></span><br><span class="menuitem"><a href="parserSTL.html">X.parserSTL</a></span><br><span class="menuitem"><a href="parserTRK.html">X.parserTRK</a></span><br><span class="menuitem"><a href="parserVTK.html">X.parserVTK</a></span><br><br><b>MATH</b><br><span class="menuitem"><a href="array.html">X.array</a></span><br><span class="menuitem"><a href="matrix.html">X.matrix</a></span><br><span class="menuitem"><a href="vector.html">X.vector</a></span><br><br><b>OBJECTS</b><br><span class="menuitem"><a href="cube.html">X.cube</a></span><br><span class="menuitem"><a href="cylinder.html">X.cylinder</a></span><br><span class="menuitem"><a href="fibers.html">X.fibers</a></span><br><span class="menuitem"><a href="labelmap.html">X.labelmap</a></span><br><span class="menuitem"><a href="mesh.html">X.mesh</a></span><br><span class="menuitem"><a href="object.html">X.object</a></span><br><span class="menuitem"><a href="slice.html">X.slice</a></span><br><span class="menuitem"><a href="sphere.html">X.sphere</a></span><br><span class="menuitem"><a href="volume.html">X.volume</a></span><br><br><b>UI</b><br><span class="menuitem"><a href="caption.html">X.caption</a></span><br><span class="menuitem"><a href="progressbar.html">X.progressbar</a></span><br><br><b>VISUALIZATION</b><br><span class="menuitem"><a href="buffer.html">X.buffer</a></span><br><span class="menuitem"><a href="camera.html">X.camera</a></span><br><span class="menuitem"><a href="camera2D.html">X.camera2D</a></span><br><span class="menuitem"><a href="camera3D.html">X.camera3D</a></span><br><span class="menuitem"><a href="indexer.html">X.indexer</a></span><br><span class="menuitem"><a href="renderer.html">X.renderer</a></span><br><span class="menuitem"><a href="renderer2D.html">X.renderer2D</a></span><br><span class="menuitem"><a href="renderer3D.html">X.renderer3D</a></span><br><span class="menuitem"><a href="shaders.html">X.shaders</a></span><br><br></div>
	<div id="diagram"></div>
	<div class="content">
		<h2>X.parser</h2>
		<div class="private" id="parser">
<pre>/**
* Create a parser for binary or ascii data.
*
* @constructor
* @extends <a href="base.html">X.base</a>
*/</pre>
<span class="code">var p = new <span class="identifier">X.parser()</span>;</span><br></div><div class="private" id="_classname">
<pre>/**
* The className of this class.
*
* @type {string}
* @protected
*/</pre>
<span class="code">p.<span class="identifier">_classname</span> = $_CLASSNAME;</span><br></div><div class="private" id="_data">
<pre>/**
* The data.
*
* @type {?ArrayBuffer}
* @protected
*/</pre>
<span class="code">p.<span class="identifier">_data</span> = $_DATA;</span><br></div><div class="private" id="_dataPointer">
<pre>/**
* The pointer to the current byte.
*
* @type {!number}
* @protected
*/</pre>
<span class="code">p.<span class="identifier">_dataPointer</span> = $_DATAPOINTER;</span><br></div><div class="private" id="_dirty">
<pre>/**
* The 'dirty' flag of this object.
*
* @type {boolean}
* @protected
*/</pre>
<span class="code">p.<span class="identifier">_dirty</span> = $_DIRTY;</span><br></div><div class="private" id="_id">
<pre>/**
* The uniqueId of this instance. Each class instance in XTK has a uniqueId.
*
* @type {number}
* @protected
*/</pre>
<span class="code">p.<span class="identifier">_id</span> = $_ID;</span><br></div><div class="private" id="_lastMax">
<pre>/**
* The max value of the last parsing attempt.
*
* @type {!number}
* @protected
*/</pre>
<span class="code">p.<span class="identifier">_lastMax</span> = $_LASTMAX;</span><br></div><div class="private" id="_lastMin">
<pre>/**
* The min value of the last parsing attempt.
*
* @type {!number}
* @protected
*/</pre>
<span class="code">p.<span class="identifier">_lastMin</span> = $_LASTMIN;</span><br></div><div class="private" id="_littleEndian">
<pre>/**
* The data-specific endianness flag.
*
* @type {!boolean}
* @protected
*/</pre>
<span class="code">p.<span class="identifier">_littleEndian</span> = $_LITTLEENDIAN;</span><br></div><div class="private" id="_nativeLittleEndian">
<pre>/**
* The native endianness flag. Based on
* https://github.com/kig/DataStream.js/blob/master/DataStream.js
*
* @type {!boolean}
* @protected
*/</pre>
<span class="code">p.<span class="identifier">_nativeLittleEndian</span> = $_NATIVELITTLEENDIAN;</span><br></div><div class="public" id="classname_get">
<pre>/**
* Get the className of this object.
*
* @return {string} The className of this object.
* @public
*/</pre>
<span class="code">var _classname = p.<span class="identifier">classname</span>;</span><br></div><div class="public" id="id_get">
<pre>/**
* Get the id of this instance.
*
* @return {string} The className of this object.
* @public
*/</pre>
<span class="code">var _id = p.<span class="identifier">id</span>;</span><br></div><div class="private" id="arrayMinMax">
<pre>/**
* Get the min and max values of an array.
*
* @param {!Array} data The data array to analyze.
* @return {!Array} An array with length 2 containing the [min, max] values.
*/</pre>
<span class="code">var arrayMinMax = p.<span class="identifier">arrayMinMax</span>($DATA);</span><br></div><div class="private" id="flipEndianness">
<pre>/**
* Flips typed array endianness in-place. Based on
* https://github.com/kig/DataStream.js/blob/master/DataStream.js.
*
* @param {!Object} array Typed array to flip.
* @param {!number} chunkSize The size of each element.
* @return {!Object} The converted typed array.
*/</pre>
<span class="code">var flipEndianness = p.<span class="identifier">flipEndianness</span>($ARRAY, $CHUNKSIZE);</span><br></div><div class="private" id="jumpTo">
<pre>/**
* Jump to a position in the byte stream.
*
* @param {!number} position The new offset.
*/</pre>
<span class="code">p.<span class="identifier">jumpTo</span>($POSITION);</span><br></div><div class="public" id="parse">
<pre>/**
* Parse data and configure the given object. When complete, a
* <a href="parser.html">X.parser</a>.ModifiedEvent is fired.
*
* @param {!<a href="base.html">X.base</a>} container A container which holds the loaded data. This can
*          be an <a href="object.html">X.object</a> as well.
* @param {!<a href="object.html">X.object</a>} object The object to configure.
* @param {!ArrayBuffer} data The data to parse.
* @param {*} flag An additional flag.
* @throws {Error} An exception if something goes wrong.
*/</pre>
<span class="code">p.<span class="identifier">parse</span>($CONTAINER, $OBJECT, $DATA, $FLAG);</span><br></div><div class="private" id="parseChars">
<pre>/**
* Create a string from a bunch of UChars. This replaces a
* String.fromCharCode.apply call and therefor supports more platforms (like the
* Android stock browser).
*
* @param {!Array|Uint8Array} array The Uint8Array.
* @param {?number=} start The start position. If undefined, use the whole
*          array.
* @param {?number=} end The end position. If undefined, use the whole array.
* @return {string} The created string.
*/</pre>
<span class="code">var parseChars = p.<span class="identifier">parseChars</span>($ARRAY, $START, $END);</span><br></div><div class="private" id="reslice">
<pre>/**
* Reslice a data stream to fill the slices of an <a href="volume.html">X.volume</a> in X,Y and Z
* directions. The given volume (object) has to be created at this point
* according to the proper dimensions. This also takes care of a possible
* associated label map which has to be loaded before.
*
* @param {!<a href="object.html">X.object</a>} object The <a href="volume.html">X.volume</a> to fill.
* @param {!Object} MRI The MRI object which contains the min, max, data and
*          type.
* @return {!Array} The volume data as a 3D Array.
*/</pre>
<span class="code">var reslice = p.<span class="identifier">reslice</span>($OBJECT, $MRI);</span><br></div><div class="private" id="reslice1DColorTable_">
<pre>/**
* Create Slice for a given colortable in one direction
*
* @param {!number} sizeX The volume size in X direction.
* @param {!number} sizeY The volume size in Y direction.
* @param {!number} sizeZ The volume size in Z direction.
* @param {!Array} image The array containing the image.
* @param {!number} max The object's max intensity.
* @param {!<a href="colortable.html">X.colortable</a>} colorTable The colortable.
* @param {!<a href="object.html">X.object</a>} targetSlice The object containing the slices to be
*          computed.
* @param {?<a href="volume.html">X.volume</a>} targetLabelMap The object containing the labelmap if any.
* @param {!boolean} invert invert rows and columns when accessing pixel value
* @protected
*/</pre>
<span class="code">p.<span class="identifier">reslice1DColorTable_</span>($SIZEX, $SIZEY, $SIZEZ, $IMAGE, $MAX, $COLORTABLE, $TARGETSLICE, $TARGETLABELMAP, $INVERT);</span><br></div><div class="private" id="reslice1D_">
<pre>/**
* Create Slice for a given volume in one direction
*
* @param {!number} sizeX The volume size in X direction.
* @param {!number} sizeY The volume size in Y direction.
* @param {!number} sizeZ The volume size in Z direction.
* @param {!Array} image The array containing the image.
* @param {!number} max The object's max intensity.
* @param {!<a href="object.html">X.object</a>} targetSlice The object containing the slices to be
*          computed.
* @param {?<a href="volume.html">X.volume</a>} targetLabelMap The object containing the labelmap if any.
* @param {!boolean} invert invert rows and columns when accessing pixel value
* @protected
*/</pre>
<span class="code">p.<span class="identifier">reslice1D_</span>($SIZEX, $SIZEY, $SIZEZ, $IMAGE, $MAX, $TARGETSLICE, $TARGETLABELMAP, $INVERT);</span><br></div><div class="private" id="reslice2DColorTable_">
<pre>/**
* Create Slices for a colortable in two direction
*
* @param {!number} sizeX The volume size in X direction.
* @param {!number} sizeY The volume size in Y direction.
* @param {!number} sizeZ The volume size in Z direction.
* @param {!Array} image The array containing the image.
* @param {!number} max The object's max intensity.
* @param {!<a href="colortable.html">X.colortable</a>} colorTable The colortable.
* @param {!<a href="object.html">X.object</a>} targetSlice1 The object containing the slices to be
*          computed.
* @param {?<a href="volume.html">X.volume</a>} targetLabelMap1 The object containing the labelmap if any.
* @param {!<a href="object.html">X.object</a>} targetSlice2 The object containing the slices to be
*          computed.
* @param {?<a href="volume.html">X.volume</a>} targetLabelMap2 The object containing the labelmap if any.
* @protected
*/</pre>
<span class="code">p.<span class="identifier">reslice2DColorTable_</span>($SIZEX, $SIZEY, $SIZEZ, $IMAGE, $MAX, $COLORTABLE, $TARGETSLICE1, $TARGETLABELMAP1, $TARGETSLICE2, $TARGETLABELMAP2);</span><br></div><div class="private" id="reslice2D_">
<pre>/**
* Create Slices for a given volume in two direction
*
* @param {!number} sizeX The volume size in X direction.
* @param {!number} sizeY The volume size in Y direction.
* @param {!number} sizeZ The volume size in Z direction.
* @param {!Array} image The array containing the image.
* @param {!number} max The object's max intensity.
* @param {!<a href="object.html">X.object</a>} targetSlice1 The object containing the slices to be
*          computed.
* @param {?<a href="volume.html">X.volume</a>} targetLabelMap1 The object containing the labelmap if any.
* @param {!<a href="object.html">X.object</a>} targetSlice2 The object containing the slices to be
*          computed.
* @param {?<a href="volume.html">X.volume</a>} targetLabelMap2 The object containing the labelmap if any.
* @protected
*/</pre>
<span class="code">p.<span class="identifier">reslice2D_</span>($SIZEX, $SIZEY, $SIZEZ, $IMAGE, $MAX, $TARGETSLICE1, $TARGETLABELMAP1, $TARGETSLICE2, $TARGETLABELMAP2);</span><br></div><div class="private" id="scan">
<pre>/**
* Scan binary data relative to the internal position in the byte stream.
*
* @param {!string} type The data type to scan, f.e.
*          'uchar','schar','ushort','sshort','uint','sint','float'
* @param {!number=} chunks The number of chunks to scan. By default, 1.
*/</pre>
<span class="code">p.<span class="identifier">scan</span>($TYPE, $CHUNKS);</span><br></div>
	</div>

  <div id="toolbox">
  <center><button id="togglBtn" type="button" onclick="javascript:toggleInternals();">Show Internals</button></center><br><br>
  <b>CONSTRUCTORS</b><br>
  <span class="private_quicklink"><a href="#parser">X.parser</a><br></span><br>
  <b>PROPERTIES</b><br>
  <span class="private_quicklink"><a href="#_classname">_classname</a><br></span><span class="private_quicklink"><a href="#_data">_data</a><br></span><span class="private_quicklink"><a href="#_dataPointer">_dataPointer</a><br></span><span class="private_quicklink"><a href="#_dirty">_dirty</a><br></span><span class="private_quicklink"><a href="#_id">_id</a><br></span><span class="private_quicklink"><a href="#_lastMax">_lastMax</a><br></span><span class="private_quicklink"><a href="#_lastMin">_lastMin</a><br></span><span class="private_quicklink"><a href="#_littleEndian">_littleEndian</a><br></span><span class="private_quicklink"><a href="#_nativeLittleEndian">_nativeLittleEndian</a><br></span><br>
  <b>GETTERS/SETTERS</b><br>
  <span class="public_quicklink"><a href="#classname_get">classname</a><br></span><span class="public_quicklink"><a href="#id_get">id</a><br></span><br>
  <b>FUNCTIONS</b><br>
  <span class="private_quicklink"><a href="#arrayMinMax">arrayMinMax</a><br></span><span class="private_quicklink"><a href="#flipEndianness">flipEndianness</a><br></span><span class="private_quicklink"><a href="#jumpTo">jumpTo</a><br></span><span class="public_quicklink"><a href="#parse">parse</a><br></span><span class="private_quicklink"><a href="#parseChars">parseChars</a><br></span><span class="private_quicklink"><a href="#reslice">reslice</a><br></span><span class="private_quicklink"><a href="#reslice1DColorTable_">reslice1DColorTable_</a><br></span><span class="private_quicklink"><a href="#reslice1D_">reslice1D_</a><br></span><span class="private_quicklink"><a href="#reslice2DColorTable_">reslice2DColorTable_</a><br></span><span class="private_quicklink"><a href="#reslice2D_">reslice2D_</a><br></span><span class="private_quicklink"><a href="#scan">scan</a><br></span><br>
  <b>STATIC</b><br>
  <br><br><br>
  <center><small><a href="https://github.com/xtk/X/blob/master/io/parser.js" target="_blank">SOURCECODE</a><br></small></center>
  </div>	
	
	<br><br><br>
</body>

</html>